Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some cross-platform portability changes #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kajott
Copy link

@kajott kajott commented Sep 5, 2024

I'm working on a project where I want to integrate libansilove into another application, but there's a catch: It needs to work on Windows and be compiled with Microsoft's compiler. Given that libansilove's _init(), _loadfile() and _clean() APIs are centered around POSIX' mmap API, these are not easily replaceable with something portable, but that's not a problem, as they are nearly trivial to reimplement. The good news is that the core of the library (i.e. ansilove_ansi() and friends) can be coerced into working, with the following two minor changes, which are part of this PR:

  • made it possible to override ANSILOVE_EXTERN with something that's not GNU specific
  • re-implemented strndup in compat/

Changes:
- made it possible to override ANSILOVE_EXTERN
  with something that's not GNU specific
- re-implemented strndup in compat/

This makes it possible to compile the core functionality
of libansilove (specifically, ansilove_ansi() and friends)
with MSVC, if some implementation of GD is available.
The _init(), _loadfile() and _clean() functions don't work
yet, as they are centered around POSIX-exclusive APIs.
This functionality is easily replaced by a few lines of
glue code though.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant